package cn.singno.springBoot.demo.ch07_profile;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main
{
	public static void main(String[] args)
        {
		AnnotationConfigApplicationContext content = new AnnotationConfigApplicationContext();
		// 先设置活动的Profile，后注册Bean配置类，不然会报Bean未定义
		content.getEnvironment().setActiveProfiles("dev");
		content.register(profileConfig.class);
		content.refresh();
		
		DemoBean demoBean = content.getBean(DemoBean.class);
		System.out.println(demoBean.getContent());
		
		content.close();
        }
}
